<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/admins/js/My97DatePicker/WdatePicker.js"></script>
<div class="admin_nrtop">
<form action="/admini/managestore/index"  method="get" style="margin:0px" id="form1">
  <div class="ad_search">
    <div class="search">
            <div class="soubox">
            <input type="text" id="quick" name="quick" value="<?php echo $this->quick?$this->quick:''; ?>" placeholder="输入物品编号/仓库号/用户名等"/>
            <input type="hidden" id="timescope" name="timescope" value="<?php echo $this->timescope?$this->timescope:'';?>" />
            <input type="hidden" id="starttime" name="starttime" value="<?php echo $this->starttime?$this->starttime:'';?>"/>
            <input type="hidden" id="endtime" name="endtime" value="<?php echo $this->endtime?$this->endtime:'';?>" />
            <input type="hidden" id="pagesize" name="pagesize" value="<?php echo $this->pagesize?$this->pagesize:10;?>" />
            <input type="hidden" id="interior" name="interior" value="<?php echo $this->interior?$this->interior:'';?>" />
            <input type="hidden" id="intype" name="intype" value="<?php echo $this->intype?$this->intype:'';?>" />
            <input type="hidden" id="startWeight" name="startWeight" value="<?php echo $this->startWeight?$this->startWeight:'';?>" />
            <input type="hidden" id="endWeight" name="endWeight" value="<?php echo $this->endWeight?$this->endWeight:'';?>" />
            <input type="hidden" id="startVolume" name="startVolume" value="<?php echo $this->startVolume?$this->startVolume:'';?>" />
            <input type="hidden" id="endVolume" name="endVolume" value="<?php echo $this->endVolume?$this->endVolume:'';?>" />
            <input type="hidden" id="shiptype" name="shiptype" value="<?php echo $this->shiptype?$this->shiptype:'';?>" />
            <input type="hidden" id="special" name="special" value="<?php echo $this->special?$this->special:'';?>" />
            <input type="hidden" id="notscan" name="notscan" value="<?php echo $this->notscan?$this->notscan:'';?>" />
            <input type="hidden" id="isdel" name="isdel" value="<?php echo $this->isdel?$this->isdel:'';?>" />
            <input type="hidden" id="history" name="history" value="<?php echo $this->history?$this->history:'';?>" />
            <input type="hidden" id="stus" name="stus" value="<?php echo $this->stus?$this->stus:'';?>" />
            <input type="hidden" id="problem" name="problem" value="<?php echo $this->problem?$this->problem:'';?>" />
        </div>
        <a href="javascript:$('#form1').submit();"><span>搜索</span></a>
    </div>

    <div class="timebox">
            <div class="ad_time">
                <div class="timezdy">
                    <div class="timeselect2">
                        <span><?php if($this->timescope){
                                switch ($this->timescope) {
                                    case "yesterday":
                                        echo "昨天";
                                        break;
                                    case "day3":
                                        echo "近3天";
                                        break;
                                    case "week":
                                        echo "本周";
                                        break;
                                    case "lastweek":
                                        echo "上周";
                                        break;
                                    case "month":
                                        echo "本月";
                                        break;
                                    case "lastmonth":
                                        echo "上月";
                                        break;
                                    case "quarter":
                                        echo "本季";
                                        break;
                                    case "lastquarter":
                                        echo "上季";
                                        break;
                                    case "year":
                                        echo "今年";
                                        break;
                                    case "lastyear":
                                        echo "去年";
                                        break;
                                    case "day7":
                                        echo "近7天";
                                        break;
                                    case "day30":
                                        echo "近30天";
                                        break;
                                    default:
                                        echo "范围选择";
                                        break;
                                }
                            }else{echo "范围选择";}?>
                        </span><i></i>
                    </div>
                    <div class="timeslelct_xl" style="display:none;">
                        <ul>
                            <li><a href="javascript:setstart('yesterday')">昨天</a></li>
                            <li><a href="javascript:setstart('day3')">近3天</a></li>
                            <li><a href="javascript:setstart('week')">本周</a></li>
                            <li><a href="javascript:setstart('lastweek')">上周</a></li>
                            <li><a href="javascript:setstart('month')">本月</a></li>
                            <li><a href="javascript:setstart('lastmonth')">上月</a></li>
                            <li><a href="javascript:setstart('quarter')">本季</a></li>
                            <li><a href="javascript:setstart('lastquarter')">上季</a></li>
                            <li><a href="javascript:setstart('year')">今年</a></li>
                            <li><a href="javascript:setstart('lastyear')">去年</a></li>
                            <li><a href="javascript:setstart('day7')">近7天</a></li>
                            <li><a href="javascript:setstart('day30')">近30天</a></li>
                        </ul>
                    </div>
                </div>
                <div class="timefw">
                    <div class="time">
                        <!--点击后悬停样式为：<div class="timeselect t_on">-->
                        <div class="timeselect"  id="stime">
                            <span id="stimeval"><?php echo $this->starttime?$this->starttime:date("Y年m月d日",mktime(0,0,0,date("m"),date("d")-90,date("Y")));?></span><i></i>
                        </div>
                        <div class="timeslelctbox">
                            <!---时间插件放此DIV-->
                        </div>
                    </div>
                    <div class="timezhi">
                        <span>至</span>
                    </div>
                    <div class="time" >
                        <div class="timeselect" id="etime">
                            <span id="etimeval"><?php echo $this->endtime?$this->endtime:date("Y年m月d日");?></span><i></i>
                        </div>
                        <div class="timeslelctbox">
                            <!---时间插件放此DIV-->
                        </div>
                    </div>
                </div>
            </div>
            <div class="timeok">
                <a href="javascript:$('#form1').submit();">确定</a>
            </div>
        </div>
    <div class="xianshi">
            <label>显示：</label>  
        <ul>
            <li <?php echo $this->pagesize?($this->pagesize==10?'class="xson"':""):'class="xson"'; ?>><a href="javascript:setpagesize(10)">10</a></li>
            <li <?php echo $this->pagesize?($this->pagesize==20?'class="xson"':""):""; ?>><a href="javascript:setpagesize(20)">20</a></li>
            <li <?php echo $this->pagesize?($this->pagesize==30?'class="xson"':""):""; ?>><a href="javascript:setpagesize(30)">30</a></li>
        </ul>
    </div>
</div>
</form>
    
<?php if($this->personal){ ?>          
<div class="gerenss">
    <h2 id="personalInfo">您正在查询<b>“<?php echo $this->personal->nikename; ?>”</b>的个人云仓库，现有库存<b><?php echo $this->personalInCount; ?></b>件 &nbsp;&nbsp; 历史库存<b><?php echo $this->personalCount; ?></b>件</h2>
    <ul>
        <li <?php if($this->history == "2"){ ?>class="gron"<?php } ?> id="personalInCount"><a href="javascript:void()">现有库存</a></li>
        <li <?php if($this->history == "1"){ ?>class="gron"<?php } ?> id="personalCount"><a href="javascript:void()" >历史库存</a></li>
    </ul>
</div>
<?php } ?>
    
</div>
<div class="biaoge">
    <div class="biaotbody">
    <table>
            <tr>
            <th class="li2">
                    <div class="lijz"><input name="" type="checkbox" value=""></div>
            </th>
            <th class="li9">
                    <div class="lileft">物品编号</div>
            </th>
            <th class="li23">
                    <div class="lileft">物品信息</div>
            </th>
            <th class="li8">
                <div class="lileft">仓库号/用户名</div>
            </th>
            <th class="li6">
                    <div class="biaoxiala">
                    <!--点击后悬停样式为：<div class="lixiala bton">-->
                    <div class="lixiala" id="courierCompany">
                        <span>快递公司</span>
                        <i id="courier"></i>
                    </div>
                    <div class="kdtc" style="display:none;">
                        <div class="kdremen">
                            <h4>热门快递公司</h4>
                            <ul>
                                <li><a href="javascript:void()" name="EMS">EMS</a></li>
                                <li><a href="javascript:void()" name="顺丰">顺丰</a></li>
                                <li><a href="javascript:void()" name="申通">申通</a></li>
                                <li><a href="javascript:void()" name="中通">中通</a></li>
                                <li><a href="javascript:void()" name="圆通">圆通</a></li>
                                <li><a href="javascript:void()" name="宅急送">宅急送</a></li>
                                <li><a href="javascript:void()" name="韵达">韵达</a></li>
                            </ul>
                        </div>
                        <div class="allkd">
                            <h4>全部快递</h4>
                            <ul class="kdzm">
                                <?php foreach ($this->words as $char){ ?>
                                    <li <?php echo $char=='A'?'class="kon"':''; ?>><a href="javascript:void()"><?php echo $char; ?></a></li>
                                <?php } ?>
                            </ul>
                            <div id="courierTb">
                                <?php foreach ($this->words as $char){ ?>
                                <ul class="kdlist" <?php echo $char=='A'?'':'style="display:none"';?>>
                                    <?php $courierList = Application_Model_shipType::getByWord($char); ?>
                                        <?php foreach($courierList as $courier){ ?>
                                            <li><a href="javascript:void()" name="<?php echo $courier->name;?>"><?php echo $courier->name; ?></a></li>
                                        <?php } ?>
                                </ul>
                                <?php } ?>                          
                            </div>
                        </div>
                    </div>

                </div>
            </th>
            <th class="li8"><div class="lileft">快递号</div></th>
            <th class="li6">
                    <div class="biaoxiala">
                    <div class="lixiala" id="sourcebton">
                        <span>来源</span>
                        <i id="source"></i>
                    </div>
                    <div class="biaoxllb" style="display:none;" id="sourcetype">
                        <ul>
                            <li><a href="javascript:source('代购订单')">代购订单</a></li>
                            <li><a href="javascript:source('自助包裹')">自助包裹</a></li>
                            <li><a href="javascript:source('上门取件')">上门取件</a></li>
                        </ul>
                    </div>
                </div>
            </th>
            <th class="li6"><div class="lileft">物品数量</div></th>
            <th class="li7">
                    <div class="biaoxiala">
                    <div class="lixiala" id="itemsWeightBton">
                        <span>物品净重(kg)</span>
                        <i id="itemsWeight"></i>
                    </div>
                    <div class="biaofw" style="display:none;" id="itemsNetWeight">
                            <input type="text" name='startWeight1' id='startWeight1'/><span>至</span><input type="text" name='endWeight1' id='endWeight1'/><a href="javascript:void()" id='weightConfirm'>确定</a>
                    </div>
                </div>

            </th>
            <th class="li7">
                    <div class="biaoxiala">
                    <div class="lixiala" id="estimatedVolumeBton">
                        <span>预估体积(kg)</span>
                        <i id="estimatedVolume"></i>
                    </div>
                    <div class="biaofw" style="display:none;" id="estimated">
                            <input type="text" name="startVolume1" id="startVolume1"/><span>至</span><input type="text" name="endVolume1" id="endVolume1"/><a href="javascript:void()" id="volumeConfirm">确定</a>
                    </div>
                </div>
            </th>
            <th class="li6"><div class="lileft">库位/操作人</div></th>
            <th class="li6">
                    <div class="biaoxiala">
                    <div class="lixiala" id="conditionBton">
                        <span>状态</span>
                        <i id="condition"></i>
                    </div>
                    <div class="biaoxllb" style="display:none;" id="conditionLb">
                            <ul>                                                                
                                <?php if($this->interiorNames){ foreach ($this->interiorNames as $key => $eccomp) { ?>
                                    <li><a href="javascript:condition(<?php echo $key; ?>)"><?php echo $eccomp; ?></a></li>
                                <?php }} ?>
                        </ul>                        
                    </div>
                </div>
            </th>
            <th class="li6"><div class="liright">操作</div></th>
        </tr>
    </table>
</div>

<?php if($this->shiptype || $this->intype || $this->startWeight || $this->endWeight ||$this->startVolume || $this->endVolume || $this->interior != null){ ?>    
<div class="xzinfo xz48">
    <ul>    <?php if($this->shiptype){ ?>
            <li id="courierli"><div class="xzinfobox"><span id="courierBox"><?php echo $this->shiptype; ?></span><a href="javascript:void()" id="shiptypeex" title="撤销"><i>撤销</i></a></div></li>
            <?php } ?>
            <?php if($this->intype){ ?>
            <li id="sourceli"><div class="xzinfobox"><span id="sourceBox"><?php echo $this->intype; ?></span><a href="javascript:void()" id="sourceex" title="撤销"><i>撤销</i></a></div></li>
            <?php } ?>
            <?php if($this->startWeight || $this->endWeight){ ?>
            <li id="weightli"><div class="xzinfobox"><span id="weightBox">净重：<?php echo $this->startWeight?$this->startWeight:"0";?>kg 至 <?php echo $this->endWeight?$this->endWeight:"最大";?>kg</span><a href="javascript:void()" id="weightex" title="撤销"><i>撤销</i></a></div></li>
            <?php } ?>
            <?php if($this->startVolume || $this->endVolume){ ?>
            <li id="volumeli"><div class="xzinfobox"><span id="volumeBox">体积重量：<?php echo $this->startVolume?$this->startVolume:"0"; ?>kg 至 <?php echo $this->endVolume?$this->endVolume:"最大";?>kg</span><a href="javascript:void()" id="volumeex" title="撤销"><i>撤销</i></a></div></li>
            <?php } ?>
            <?php if($this->interior != null){ ?>
            <li id="interiorli"><div class="xzinfobox"><span id="interiorBox"><?php echo Application_Model_StoreItem::interiorNameByNum($this->interior);?></span><a href="javascript:void()" title="撤销" id="interiorex"><i>撤销</i></a></div></li>
            <?php } ?>
    </ul>
</div>
<?php } ?>    
    
<div class="table">
    <table>
        
        <?php foreach ($this->StoreItemList as $Item) { ?> 
            <tr>
            <td class="li2"><div class="lijz"><input type="checkbox" id="chk<?php echo $Item->id; ?>" name="ID" /></div></td>
            <td class="li9">
                    <div class="lileft bianhao">
                    <p><a href="/admini/managestore/storedetail/id/<?php echo $Item->id; ?>"><?php echo $Item->barcode; ?></a></p>
                    <span><?php echo $Item->dateInStore;?></span>
                </div>
            </td>
            <td class="li23">
                    <div class="lileft wpinfo">
                    <div class="spic">
                            <a href="/admini/managestore/storedetail/id/<?php echo $Item->id; ?>"><img src="<?= $this->cdn ?><?php echo str_replace("http://www.uuch.com", "", $Item->image);?>"></a>
                    </div>
                                                    <div class="wpinfobox">
                            <h2><a href="/admini/managestore/storedetail/id/<?php echo $Item->id; ?>"><?php echo $Item->productName; ?></a></h2>
                            <p>属性：<?php echo $Item->ItemTypeName; ?><?php if($Item->cnShipFee>0){?><span style="color:#c00;">（国内到付：<?php echo $Item->cnShipFee;?>）</span><?php } ?></p>
                    </div>
                </div>
            </td>
            
            <td class="li7">
                    <div class="lileft yonghu" style="width:100px;">
                    <p><a href="/admini/managestore/index/quick/<?php echo $Item->userinfo->storeno;?>"><?php echo $Item->userinfo!=null?$Item->userinfo->storeno:"用户出错"; ?></a></p>
                    <h3><a href="/admini/manageuser/userdetail/id/<?php echo $Item->userinfo?$Item->userinfo->id:""; ?>"><?php echo $Item->userinfo!=null?$Item->userinfo->nikename:"用户出错"; ?></a></h3>
                </div>
            </td>
            <td class="li6">
                    <div class="lileft">
                    <?php
                        if($Item->LogisticsName){
                            echo $Item->LogisticsName;
                            
                        }else{
                            $b= (strpos($Item->orderNo,"["));
                            $c= (strpos($Item->orderNo,"]"));
                            echo substr($Item->orderNo,$b+1,$c-1)?substr($Item->orderNo,$b+1,$c-1):"暂无";
                        }
                     ?>
                </div>
            </td>
            <td class="li8">
                    <div class="lileft">
                    <?php if($Item->orderNo != null){ ?>    
                    <?php $arrorder = explode(']',$Item->orderNo);echo count($arrorder)>1 ?$arrorder[1]:$Item->Logistics;?>
                    <?php }else{echo "暂无";} ?>    
                </div>
            </td>
            <td class="li6">
                    <div class="lileft">
                     <?php echo $Item->intype?$Item->intype:"无来源";?>
                </div>
            </td>
            <td class="li6">
                    <div class="lileft">
                     <?php echo $Item->quantity;?>
                </div>
            </td>
            <td class="li7">
                    <div class="lileft">
                    <?php echo $Item->weight?$Item->weight/1000:"暂无";?>
                </div>
            </td>
            <td class="li7">
                    <div class="lileft">
                    <?php echo $Item->volumeWeight?$Item->volumeWeight/1000:"暂无"; ?>
                </div>
            </td>
            <td class="li6">
                <div class="lileft">
                    <p><?php echo $Item->locationNo?$Item->locationNo:"暂无"?></p>
                    <p><?php echo $Item->operateName;?></p>
                </div>
            </td>
            <td class="li6">
                    <div class="lileft">
                    内：<?php echo $Item->InteriorName;?><br/><font color="red">外：(<?php echo $Item->StatusName; ?>)</font>
                </div>
            </td>
            <td class="li6">
                <?php if($Item->isdelete == 1){ ?>
                    <span style="float:right;margin-right: 20px;color:red;">已删除</span>
                <?php }else{ ?>
                    <div class="lixlnav">
                        <a class="xlnavxq" href="/admini/managestore/storedetail/id/<?php echo $Item->id; ?>">详情</a>
                        <div class="xlnavlistbox">
                                <a class="xlnavsj" href="javascript:void();"><i></i></a>
                            <div class="xlnavlist" style="display:none;">
                                <ul>
                                        <li><a href="/admini/managestore/storedetail/id/<?php echo $Item->id;?>/quickedit/edit">编辑</a></li>
                                        <li><a href="javascript:void(this)" class="delstoreitembyid" name="<?php echo $Item->id;?>">丢弃</a></li>
                                </ul>
                            </div>
                        </div>
                   </div>
                <?php } ?>
            </td>
        </tr>
        <?php } ?>
        <?php 
            if(!$this->StoreItemList){
                echo "<font size='4' color='red'>暂无数据</font>";
            }
        ?>               
    </table>
    <input class="button" id="launch-button" type="button" value="发起运单" style="width:80px;height:32px;margin-top:20px;" />
    <input class="button" id="exchange-button" type="button" value="退换货" style="width:80px;height:32px;margin-top:20px;" />
</div>
</div>

<div class="toolbar" <?php if (empty($this->StoreItemList)) echo "style='display: none'"; ?>>
        <?php echo $this->partial('paging.phtml', array("pages" => $this->StoreItem,"pamas"=>"quick=$this->quick&pagesize=$this->pagesize&starttime=$this->starttime&endtime=$this->endtime&interior=$this->interior&intype=$this->intype&startWeight=$this->startWeight&endWeight=$this->endWeight&startVolume=$this->startVolume&endVolume=$this->endVolume&shiptype=$this->shiptype&special=$this->special&notscan=$this->notscan&isdel=$this->isdel&history=$this->history&stus=$this->stus&problem=$this->problem")); ?>
</div> 

<table>    
<tfoot>
      <tr>
          <td colspan="2">　
              &nbsp;&nbsp;&nbsp;<button class="button" id="csv-button" style="background-color: #1668A4;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px; margin-bottom:10px;">导出csv</button>
          </td></tr>
</tfoot>    
</table>

<script type="text/javascript">
    
    $(".xlnavsj").live("mousemove",function(){
        $(this).next("div").attr("style","display:block;");
    });
    $(".lixlnav").mouseleave(function(){
        $(".xlnavsj").next("div").attr("style","display:none;");
    });    
    function setpagesize(size)
    {
        $(".xianshi ul li").attr("class","");
        $(".soubox #pagesize").val(size);
        $('#form1').submit();
    }
    
    if($("#quick").val() != ""){
        $(".soubox label").attr("style","display:none;");
    }
    $('.soubox label').click(function(){
            $(this).parent().find('input').focus();
    });
    $('#quick').keyup(function(){
        if($(this).val()=='')
            $(this).next().show();
        else
            $(this).next().hide();
    });       
    $(".timezdy").click(function(){
        $(".timezdy .timeselect2").attr("class","timeselect2 timeon");
        $(".timeslelct_xl").attr("style","display:block;");
    });
    $(".timezdy").mouseleave(function(){
       $(".timeselect2").attr("class","timeselect2");
       $(".timeslelct_xl").attr("style","display:none;");
    });
    $("#stime").click(function(){
        $(this).attr("class","timeselect t_on");
        WdatePicker({el:'stimeval',dateFmt:'yyyy年M月d日',vel:'starttime',onpicked:function(){
                $("#stime,#etime").attr("class","timeselect");
                $(".soubox #timescope").val("");
        }});
    });
    $("#etime").click(function(){
        $(this).attr("class","timeselect t_on");
        WdatePicker({el:'etimeval',dateFmt:'yyyy年M月d日',vel:'endtime',onpicked:function(){
                $("#stime,#etime").attr("class","timeselect");
                $(".soubox #timescope").val("");
        }});
        
    });    
    function setstart(start)
    {
        $(".soubox #timescope").val(start);
        $(".timeselect2").attr("class","timeselect2");
        $(".timeslelct_xl").attr("style","display:none;");
        $('#form1').submit();
    }
    $('.kdzm a').each(function(index,item){
        $(item).click(function(){
            $('.kdzm li.kon').removeClass('kon');
            $(this).parent().addClass('kon');
            $('#courierTb ul').hide();
            $('#courierTb ul').eq(index).show();
            return false;
        });
    });    
    $('.kdlist a').bind('click',function(){
         $(".soubox #shiptype").val($(this).attr('name'));
         $('#form1').submit();
    });
    $('.kdremen a').bind('click',function(){
         $(".soubox #shiptype").val($(this).attr('name'));
         $('#form1').submit();
    });    
    $('#courier').live("mousemove",function(){
        $('#courierCompany').attr("class",'lixiala bton');
        $('.kdtc').show();
    });
    $('.kdtc').live('mouseleave',function(){
        $('#courierCompany').attr("class",'lixiala');
        $('.kdtc').hide();
    });
    $('#source').live("mousemove",function(){
        $('#sourcebton').attr("class","lixiala bton");
        $('#sourcetype').show();
    });
    $('#sourcetype').live("mouseleave",function(){
        $('#sourcebton').attr("class","lixiala");
        $('#sourcetype').hide();
    });
    $('#itemsWeight').live("mousemove",function(){
       $('#itemsNetWeight').show();
       $('#itemsWeightBton').attr("class","lixiala bton");
    });
    $('#itemsNetWeight').live("mouseleave",function(){
       $('#itemsNetWeight').hide();
       $('#itemsWeightBton').attr("class","lixiala");
    });
    $('#estimatedVolume').live('mousemove',function(){
       $('#estimated').show();
       $('#estimatedVolumeBton').attr("class","lixiala bton");
    });
    $('#estimated').live('mouseleave',function(){
       $('#estimated').hide();
       $('#estimatedVolumeBton').attr("class","lixiala");
    });
    $('#condition').live("mousemove",function(){
       $('#conditionLb').show();
       $('#conditionBton').attr("class","lixiala bton");;
    });
    $('#conditionLb').live("mouseleave",function(){
       $('#conditionLb').hide();
       $('#conditionBton').attr("class","lixiala");;
    });
    
    $('.delstoreitembyid').live("click",function(){
        if(confirm("确定要丢弃？")){
            var delid = this.name;
            $.ajax({
                type: 'GET',       
                url: "/admini/managestore/delstoreitembyid/id/"+delid,
                success: function(data){
                    if(data.type === 1){
                        alert("丢弃成功");
                        history.go(0);
                    }else{
                        alert("丢弃失败");
                    }
                }
             });
        }
    });
    
    function condition(interior){
        $('#interior').val(interior);
        $('#form1').submit();
    }    
    function source(intype){
        $('#intype').val(intype);
        $('#form1').submit();
    }
    $('#weightConfirm').click(function(){
        var startWeight = $('#startWeight1').val();
        var endWeight = $('#endWeight1').val();
        $('#startWeight').val(startWeight);
        $('#endWeight').val(endWeight);
        $('#form1').submit();
    });
    $('#volumeConfirm').click(function(){
        var startVolume = $('#startVolume1').val();
        var endVolume = $('#endVolume1').val();
        $('#startVolume').val(startVolume);
        $('#endVolume').val(endVolume);
        $('#form1').submit();
    });
    $('#interiorex').click(function(){
        $('#interior').val("");
        $('#interiorBox').hide();
        $('#form1').submit();        
    });
    $('#sourceex').click(function(){
        $('#intype').val("");
        $('#sourceBox').hide();
        $('#form1').submit();        
    });
    $('#weightex').click(function(){
        $('#startWeight').val("");
        $('#endWeight').val("");
        $('#weightBox').hide();
        $('#form1').submit();
    });
    $('#volumeex').click(function(){
        $('#startVolume').val("");
        $('#endVolume').val("");
        $('#volumeBox').hide();
        $('#form1').submit();
    });
    $('#shiptypeex').click(function(){
        $('#shiptype').val("");
        $('#courierBox').hide();
        $('#form1').submit();        
    });
    $('#personalInCount').click(function(){
        $('#history').val("2");
        $('#form1').submit();
    });
    $('#personalCount').click(function(){
        $('#history').val("1");
        $('#form1').submit();
    });
    $("#launch-button").click(function(){
        var idlist = '';
        $('input[name="ID"]:checked').each(function(){   
                var id = $(this).attr("id");
                id=id.replace(/[^\d]*/ig,"");
		idlist+= id+',';
	});
        if(idlist === ''){
            alert("请选择物品");
            return false;
        }else{  
           location.href='/admini/managestore/launch/id/'+idlist;
        }
    });
    $("#exchange-button").click(function(){
        var idlist = '';
        $('input[name="ID"]:checked').each(function(){   
                var id = $(this).attr("id");
                id=id.replace(/[^\d]*/ig,"");
		idlist+= id+',';
	});
        if(idlist === ''){
            alert("请选择物品");
            return false;
        }else{  
           location.href='/admini/returngoods/exchange/idlist/'+idlist;
        }
    });
	
    $('#csv-button').click(function(){
        if(confirm("确定要导出！")){
            $('#pagesize').val('50');
            $('.soubox').html($('.soubox').html()+'<input type="hidden" id="export" name="export" value="csv" />');
            $('#form1').submit();
            $('#pagesize').val('10');
            $('#export').val("");
        }
    });
	
</script>